/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.cip.esymons.tramite.bc;

import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import org.cip.esymons.tramite.be.ResponsableProc;

/**
 *
 * @author ChristianATE
 */
public class ResponsableProcDelegate {

    private ResponsableProcFacadeLocal local;

    public ResponsableProcDelegate() {
        local= lookupResponsableProcFacade();
    }

    public void create(ResponsableProc responsableProc)
    {
        local.create(responsableProc);
    }

    public void edit(ResponsableProc responsableProc)
    {
        local.edit(responsableProc);
    }

    public void remove(ResponsableProc responsableProc)
    {
        local.remove(responsableProc);
    }

    public ResponsableProc find(Long id)
    {
        return local.find(id);
    }

    public List<ResponsableProc> findAll()
    {
        return local.findAll();
    }

    private ResponsableProcFacadeLocal lookupResponsableProcFacade() {
        try {
            Context c = new InitialContext();
            return (ResponsableProcFacadeLocal) c.lookup("java:comp/env/ResponsableProcFacade");
        } catch (NamingException ne) {
            Logger.getLogger(getClass().getName()).log(Level.SEVERE, "exception caught", ne);
            throw new RuntimeException(ne);
        }
    }

}
